//
//  WoodworkViewController.m
//  mhome
//
//  Created by 刘春雷 on 2018/11/29.
//  Copyright © 2018年 刘春雷. All rights reserved.
//

#import "WoodworkViewController.h"

@interface WoodworkViewController ()
@property(nonatomic,strong)UIScrollView *scroll;
@end

@implementation WoodworkViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"木工工程";
    self.scroll = [[UIScrollView alloc]initWithFrame:CGRects(0, 0, 375, 667)];
    self.scroll.contentSize = CGSizeMake(0 , (667+300)*kHeightScale);
    self.scroll.backgroundColor = [UIColor whiteColor];
    self.scroll.pagingEnabled = NO;//是否允许整也翻
    self.scroll.bounces = NO;//关闭弹簧效果
    self.scroll.showsVerticalScrollIndicator = NO;//是否显示垂直滚动条
    [self.view addSubview:self.scroll];
    [self setUI];
}
- (void)setUI {
    UIImageView*headImage=[[UIImageView alloc] initWithFrame:CGRects(0, 0, 375, 135)];
    headImage.backgroundColor = [UIColor grayColor];
    headImage.image=[UIImage imageNamed:@"construct-ban"];
    [self.scroll addSubview:headImage];
    for(int i = 0; i< 2;i++){
        UILabel*title=[[UILabel alloc ] init];
        title.font=[UIFont systemFontOfSize:20.0*BIZ];//字体大小
        [self.scroll addSubview:title];
        UILabel*content=[[UILabel alloc] init];
        content.numberOfLines = 0;
        content.font=[UIFont systemFontOfSize:13.0*BIZ];//字体大小
        content.textColor=[UIColor grayColor];
        [self.scroll addSubview:content];
        UIImageView*imgOne=[[UIImageView alloc] init];
        [self.scroll addSubview:imgOne];
        if(i == 0){
            title.frame = CGRects(15, 170, 300, 30);
            title.text=@"吊杆安装要求";
            content.frame = CGRects(15, 200, 345, 220);
            content.text= @" ● 吊杆垂直,不得弯曲。\n ● 吊杆间距≤1000mm。\n ● 吊杆与主龙骨端部距离≤300mm,其距离＞300mm时,应增加吊杆;当吊杆长度＞1500mm时,应设置反支撑。\n ● 主龙骨间距≤ 1000mm。\n ● 副龙骨间距≤ 300mm,副龙骨的搭接间隙≤2mm。\n ● 施工时必须严格按图和规范施工,不得随意加大龙骨、吊筋的 间距。\n ● 当龙骨与灯具位置重叠时,应适当调整龙骨位置,避开灯具位置。";
            imgOne.frame = CGRects(20, 420, 335, 140);
            imgOne.image=[UIImage imageNamed:@"wood1"];
        }else{
            title.frame = CGRects(15, 580, 300, 30);
            title.text=@"转角工艺";
            content.frame = CGRects(15, 610, 345, 140);
            content.text= @" ● 顶部石膏板转角应用“7”字型拼接,防止开裂。\n ● 纸面石膏板螺钉与板边距离:纸包边宜为10-15mm,切割边宜为15-20mm。\n ● 板周边钉距宜为150-170mm,板中部钉距≤ 200mm。\n ● 螺钉帽嵌入石膏板纸面0.5-1mm,不得压破纸面。\n ● 封板宜用底板托侧板,侧板要错缝。";
            imgOne.frame = CGRects(20, 750, 335, 140);
            imgOne.image=[UIImage imageNamed:@"wood2"];
        }
        //改变label的间边距
        NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:content.text];
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
        [paragraphStyle setLineSpacing:6];
        [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [content.text length])];
        content.attributedText = attributedString;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
